home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-08-17 | 49.7 KB | 1,817 lines | [TEXT/MPS ] |
- ;
- ; File: Icons.a
- ;
- ; Contains: Icon Utilities and Icon Services Interfaces.
- ;
- ; Version: Technology: Mac OS 8
- ; Release: Universal Interfaces 3.2
- ;
- ; Copyright: © 1990-1998 by Apple Computer, Inc. All rights reserved
- ;
- ; Bugs?: For bug reports, consult the following page on
- ; the World Wide Web:
- ;
- ; http://developer.apple.com/bugreporter/
- ;
- ;
- IF &TYPE('__ICONS__') = 'UNDEFINED' THEN
- __ICONS__ SET 1
-
- IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
- include 'MacTypes.a'
- ENDIF
- IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
- include 'Quickdraw.a'
- ENDIF
- IF &TYPE('__FILES__') = 'UNDEFINED' THEN
- include 'Files.a'
- ENDIF
- IF &TYPE('__CODEFRAGMENTS__') = 'UNDEFINED' THEN
- include 'CodeFragments.a'
- ENDIF
-
- ; The following are icons for which there are both icon suites and SICNs.
- ; Avoid using icon resources if possible. Use IconServices instead.
-
- kGenericDocumentIconResource EQU -4000
- kGenericStationeryIconResource EQU -3985
- kGenericEditionFileIconResource EQU -3989
- kGenericApplicationIconResource EQU -3996
- kGenericDeskAccessoryIconResource EQU -3991
- kGenericFolderIconResource EQU -3999
- kPrivateFolderIconResource EQU -3994
- kFloppyIconResource EQU -3998
- kTrashIconResource EQU -3993
- kGenericRAMDiskIconResource EQU -3988
- kGenericCDROMIconResource EQU -3987
- ; The following are icons for which there are SICNs only.
- ; Avoid using icon resources if possible. Use IconServices instead.
-
- kDesktopIconResource EQU -3992
- kOpenFolderIconResource EQU -3997
- kGenericHardDiskIconResource EQU -3995
- kGenericFileServerIconResource EQU -3972
- kGenericSuitcaseIconResource EQU -3970
- kGenericMoverObjectIconResource EQU -3969
- ; The following are icons for which there are icon suites only.
- ; Avoid using icon resources if possible. Use IconServices instead.
-
- kGenericPreferencesIconResource EQU -3971
- kGenericQueryDocumentIconResource EQU -16506
- kGenericExtensionIconResource EQU -16415
- kSystemFolderIconResource EQU -3983
- kHelpIconResource EQU -20271
- kAppleMenuFolderIconResource EQU -3982
- ; Obsolete. Use named constants defined above.
-
- genericDocumentIconResource EQU -4000
- genericStationeryIconResource EQU -3985
- genericEditionFileIconResource EQU -3989
- genericApplicationIconResource EQU -3996
- genericDeskAccessoryIconResource EQU -3991
- genericFolderIconResource EQU -3999
- privateFolderIconResource EQU -3994
- floppyIconResource EQU -3998
- trashIconResource EQU -3993
- genericRAMDiskIconResource EQU -3988
- genericCDROMIconResource EQU -3987
- desktopIconResource EQU -3992
- openFolderIconResource EQU -3997
- genericHardDiskIconResource EQU -3995
- genericFileServerIconResource EQU -3972
- genericSuitcaseIconResource EQU -3970
- genericMoverObjectIconResource EQU -3969
- genericPreferencesIconResource EQU -3971
- genericQueryDocumentIconResource EQU -16506
- genericExtensionIconResource EQU -16415
- systemFolderIconResource EQU -3983
- appleMenuFolderIconResource EQU -3982
- ; Avoid using icon resources if possible. Use IconServices instead.
-
- kStartupFolderIconResource EQU -3981
- kOwnedFolderIconResource EQU -3980
- kDropFolderIconResource EQU -3979
- kSharedFolderIconResource EQU -3978
- kMountedFolderIconResource EQU -3977
- kControlPanelFolderIconResource EQU -3976
- kPrintMonitorFolderIconResource EQU -3975
- kPreferencesFolderIconResource EQU -3974
- kExtensionsFolderIconResource EQU -3973
- kFontsFolderIconResource EQU -3968
- kFullTrashIconResource EQU -3984
- ; Obsolete. Use named constants defined above.
-
- startupFolderIconResource EQU -3981
- ownedFolderIconResource EQU -3980
- dropFolderIconResource EQU -3979
- sharedFolderIconResource EQU -3978
- mountedFolderIconResource EQU -3977
- controlPanelFolderIconResource EQU -3976
- printMonitorFolderIconResource EQU -3975
- preferencesFolderIconResource EQU -3974
- extensionsFolderIconResource EQU -3973
- fontsFolderIconResource EQU -3968
- fullTrashIconResource EQU -3984
-
- kHuge1BitMask EQU 'ich#'
- kHuge4BitData EQU 'ich4'
- kHuge8BitData EQU 'ich8'
- kHuge32BitData EQU 'ih32'
- kHuge8BitMask EQU 'h8mk'
- kLarge1BitMask EQU 'ICN#'
- kLarge4BitData EQU 'icl4'
- kLarge8BitData EQU 'icl8'
- kLarge32BitData EQU 'il32'
- kLarge8BitMask EQU 'l8mk'
- kSmall1BitMask EQU 'ics#'
- kSmall4BitData EQU 'ics4'
- kSmall8BitData EQU 'ics8'
- kSmall32BitData EQU 'is32'
- kSmall8BitMask EQU 's8mk'
- kMini1BitMask EQU 'icm#'
- kMini4BitData EQU 'icm4'
- kMini8BitData EQU 'icm8'
- ; Obsolete. Use names defined above.
-
- large1BitMask EQU 'ICN#'
- large4BitData EQU 'icl4'
- large8BitData EQU 'icl8'
- small1BitMask EQU 'ics#'
- small4BitData EQU 'ics4'
- small8BitData EQU 'ics8'
- mini1BitMask EQU 'icm#'
- mini4BitData EQU 'icm4'
- mini8BitData EQU 'icm8'
- ; Alignment type values.
-
- kAlignNone EQU $00
- kAlignVerticalCenter EQU $01
- kAlignTop EQU $02
- kAlignBottom EQU $03
- kAlignHorizontalCenter EQU $04
- kAlignAbsoluteCenter EQU $05
- kAlignCenterTop EQU $06
- kAlignCenterBottom EQU $07
- kAlignLeft EQU $08
- kAlignCenterLeft EQU $09
- kAlignTopLeft EQU $0A
- kAlignBottomLeft EQU $0B
- kAlignRight EQU $0C
- kAlignCenterRight EQU $0D
- kAlignTopRight EQU $0E
- kAlignBottomRight EQU $0F
- ; Obsolete. Use names defined above.
-
- atNone EQU $00
- atVerticalCenter EQU $01
- atTop EQU $02
- atBottom EQU $03
- atHorizontalCenter EQU $04
- atAbsoluteCenter EQU $05
- atCenterTop EQU $06
- atCenterBottom EQU $07
- atLeft EQU $08
- atCenterLeft EQU $09
- atTopLeft EQU $0A
- atBottomLeft EQU $0B
- atRight EQU $0C
- atCenterRight EQU $0D
- atTopRight EQU $0E
- atBottomRight EQU $0F
- ; typedef SInt16 IconAlignmentType
-
- ; Transform type values.
-
- kTransformNone EQU $00
- kTransformDisabled EQU $01
- kTransformOffline EQU $02
- kTransformOpen EQU $03
- kTransformLabel1 EQU $0100
- kTransformLabel2 EQU $0200
- kTransformLabel3 EQU $0300
- kTransformLabel4 EQU $0400
- kTransformLabel5 EQU $0500
- kTransformLabel6 EQU $0600
- kTransformLabel7 EQU $0700
- kTransformSelected EQU $4000
- kTransformSelectedDisabled EQU $4001
- kTransformSelectedOffline EQU $4002
- kTransformSelectedOpen EQU $4003
- ; Obsolete. Use names defined above.
-
- ttNone EQU $00
- ttDisabled EQU $01
- ttOffline EQU $02
- ttOpen EQU $03
- ttLabel1 EQU $0100
- ttLabel2 EQU $0200
- ttLabel3 EQU $0300
- ttLabel4 EQU $0400
- ttLabel5 EQU $0500
- ttLabel6 EQU $0600
- ttLabel7 EQU $0700
- ttSelected EQU $4000
- ttSelectedDisabled EQU $4001
- ttSelectedOffline EQU $4002
- ttSelectedOpen EQU $4003
- ; typedef SInt16 IconTransformType
-
- ; Selector mask values.
-
- kSelectorLarge1Bit EQU $00000001
- kSelectorLarge4Bit EQU $00000002
- kSelectorLarge8Bit EQU $00000004
- kSelectorLarge32Bit EQU $00000008
- kSelectorLarge8BitMask EQU $00000010
- kSelectorSmall1Bit EQU $00000100
- kSelectorSmall4Bit EQU $00000200
- kSelectorSmall8Bit EQU $00000400
- kSelectorSmall32Bit EQU $00000800
- kSelectorSmall8BitMask EQU $00001000
- kSelectorMini1Bit EQU $00010000
- kSelectorMini4Bit EQU $00020000
- kSelectorMini8Bit EQU $00040000
- kSelectorHuge1Bit EQU $01000000
- kSelectorHuge4Bit EQU $02000000
- kSelectorHuge8Bit EQU $04000000
- kSelectorHuge32Bit EQU $08000000
- kSelectorHuge8BitMask EQU $10000000
- kSelectorAllLargeData EQU $000000FF
- kSelectorAllSmallData EQU $0000FF00
- kSelectorAllMiniData EQU $00FF0000
- kSelectorAllHugeData EQU $FF000000
- kSelectorAll1BitData EQU $01010101
- kSelectorAll4BitData EQU $02020202
- kSelectorAll8BitData EQU $04040404
- kSelectorAll32BitData EQU $08000808
- kSelectorAllAvailableData EQU $FFFFFFFF
-
- ; Obsolete. Use names defined above.
-
- svLarge1Bit EQU $00000001
- svLarge4Bit EQU $00000002
- svLarge8Bit EQU $00000004
- svSmall1Bit EQU $00000100
- svSmall4Bit EQU $00000200
- svSmall8Bit EQU $00000400
- svMini1Bit EQU $00010000
- svMini4Bit EQU $00020000
- svMini8Bit EQU $00040000
- svAllLargeData EQU $000000FF
- svAllSmallData EQU $0000FF00
- svAllMiniData EQU $00FF0000
- svAll1BitData EQU $01010101
- svAll4BitData EQU $02020202
- svAll8BitData EQU $04040404
- svAllAvailableData EQU $FFFFFFFF
- ; typedef UInt32 IconSelectorValue
-
- ; typedef IconActionProcPtr IconAction
-
- ; typedef IconGetterProcPtr IconGetter
-
- IF ¬ OLDROUTINELOCATIONS THEN
- CIcon RECORD 0
- iconPMap ds PixMap ; offset: $0 (0) ; the icon's pixMap
- iconMask ds BitMap ; offset: $32 (50) ; the icon's mask
- iconBMap ds BitMap ; offset: $40 (64) ; the icon's bitMap
- iconData ds.l 1 ; offset: $4E (78) ; the icon's data
- iconMaskData ds.w 1 ; offset: $52 (82) <-- really an array of length one ; icon's mask and BitMap data
- sizeof EQU * ; size: $54 (84)
- ENDR
- ; typedef struct CIcon * CIconPtr
-
- ; typedef CIconPtr * CIconHandle
-
- ;
- ; pascal CIconHandle GetCIcon(SInt16 iconID)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- _GetCIcon: OPWORD $AA1E
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetCIcon
- ENDIF
-
- ;
- ; pascal void PlotCIcon(const Rect *theRect, CIconHandle theIcon)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- _PlotCIcon: OPWORD $AA1F
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION PlotCIcon
- ENDIF
-
- ;
- ; pascal void DisposeCIcon(CIconHandle theIcon)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- _DisposeCIcon: OPWORD $AA25
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION DisposeCIcon
- ENDIF
-
- ENDIF
- ;
- ; pascal Handle GetIcon(SInt16 iconID)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- _GetIcon: OPWORD $A9BB
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetIcon
- ENDIF
-
- ;
- ; pascal void PlotIcon(const Rect *theRect, Handle theIcon)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- _PlotIcon: OPWORD $A94B
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION PlotIcon
- ENDIF
-
-
-
- ;
- ; Note: IconSuiteRef and IconCacheRef should be an abstract types,
- ; but too much source code already relies on them being of type Handle.
- ;
-
- ; typedef Handle IconSuiteRef
-
- ; typedef Handle IconCacheRef
-
- ; IconRefs are 32-bit values identifying cached icon data. IconRef 0 is invalid.
-
-
- ;
- ; pascal OSErr PlotIconID(const Rect *theRect, IconAlignmentType align, IconTransformType transform, SInt16 theResID)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _PlotIconID
- move.w #$0500,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION PlotIconID
- ENDIF
-
- ;
- ; pascal OSErr NewIconSuite(IconSuiteRef *theIconSuite)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _NewIconSuite
- move.w #$0207,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION NewIconSuite
- ENDIF
-
- ;
- ; pascal OSErr AddIconToSuite(Handle theIconData, IconSuiteRef theSuite, ResType theType)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _AddIconToSuite
- move.w #$0608,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION AddIconToSuite
- ENDIF
-
- ;
- ; pascal OSErr GetIconFromSuite(Handle *theIconData, IconSuiteRef theSuite, ResType theType)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _GetIconFromSuite
- move.w #$0609,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetIconFromSuite
- ENDIF
-
- ;
- ; pascal OSErr ForEachIconDo(IconSuiteRef theSuite, IconSelectorValue selector, IconActionUPP action, void *yourDataPtr)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _ForEachIconDo
- move.w #$080A,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION ForEachIconDo
- ENDIF
-
- ;
- ; pascal OSErr GetIconSuite(IconSuiteRef *theIconSuite, SInt16 theResID, IconSelectorValue selector)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _GetIconSuite
- move.w #$0501,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetIconSuite
- ENDIF
-
- ;
- ; pascal OSErr DisposeIconSuite(IconSuiteRef theIconSuite, Boolean disposeData)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _DisposeIconSuite
- move.w #$0302,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION DisposeIconSuite
- ENDIF
-
- ;
- ; pascal OSErr PlotIconSuite(const Rect *theRect, IconAlignmentType align, IconTransformType transform, IconSuiteRef theIconSuite)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _PlotIconSuite
- move.w #$0603,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION PlotIconSuite
- ENDIF
-
- ;
- ; pascal OSErr MakeIconCache(IconCacheRef *theCache, IconGetterUPP makeIcon, void *yourDataPtr)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _MakeIconCache
- move.w #$0604,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION MakeIconCache
- ENDIF
-
- ;
- ; pascal OSErr LoadIconCache(const Rect *theRect, IconAlignmentType align, IconTransformType transform, IconCacheRef theIconCache)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _LoadIconCache
- move.w #$0606,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION LoadIconCache
- ENDIF
-
- ;
- ; pascal OSErr PlotIconMethod(const Rect *theRect, IconAlignmentType align, IconTransformType transform, IconGetterUPP theMethod, void *yourDataPtr)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _PlotIconMethod
- move.w #$0805,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION PlotIconMethod
- ENDIF
-
- ;
- ; pascal OSErr GetLabel(SInt16 labelNumber, RGBColor *labelColor, Str255 labelString)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _GetLabel
- move.w #$050B,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetLabel
- ENDIF
-
- ;
- ; pascal Boolean PtInIconID(Point testPt, const Rect *iconRect, IconAlignmentType align, SInt16 iconID)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _PtInIconID
- move.w #$060D,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION PtInIconID
- ENDIF
-
- ;
- ; pascal Boolean PtInIconSuite(Point testPt, const Rect *iconRect, IconAlignmentType align, IconSuiteRef theIconSuite)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _PtInIconSuite
- move.w #$070E,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION PtInIconSuite
- ENDIF
-
- ;
- ; pascal Boolean PtInIconMethod(Point testPt, const Rect *iconRect, IconAlignmentType align, IconGetterUPP theMethod, void *yourDataPtr)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _PtInIconMethod
- move.w #$090F,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION PtInIconMethod
- ENDIF
-
- ;
- ; pascal Boolean RectInIconID(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, SInt16 iconID)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _RectInIconID
- move.w #$0610,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION RectInIconID
- ENDIF
-
- ;
- ; pascal Boolean RectInIconSuite(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, IconSuiteRef theIconSuite)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _RectInIconSuite
- move.w #$0711,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION RectInIconSuite
- ENDIF
-
- ;
- ; pascal Boolean RectInIconMethod(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, IconGetterUPP theMethod, void *yourDataPtr)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _RectInIconMethod
- move.w #$0912,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION RectInIconMethod
- ENDIF
-
- ;
- ; pascal OSErr IconIDToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, SInt16 iconID)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _IconIDToRgn
- move.w #$0613,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IconIDToRgn
- ENDIF
-
- ;
- ; pascal OSErr IconSuiteToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, IconSuiteRef theIconSuite)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _IconSuiteToRgn
- move.w #$0714,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IconSuiteToRgn
- ENDIF
-
- ;
- ; pascal OSErr IconMethodToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, IconGetterUPP theMethod, void *yourDataPtr)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _IconMethodToRgn
- move.w #$0915,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IconMethodToRgn
- ENDIF
-
- ;
- ; pascal OSErr SetSuiteLabel(IconSuiteRef theSuite, SInt16 theLabel)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _SetSuiteLabel
- move.w #$0316,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION SetSuiteLabel
- ENDIF
-
- ;
- ; pascal SInt16 GetSuiteLabel(IconSuiteRef theSuite)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _GetSuiteLabel
- move.w #$0217,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetSuiteLabel
- ENDIF
-
- ;
- ; pascal OSErr GetIconCacheData(IconCacheRef theCache, void **theData)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _GetIconCacheData
- move.w #$0419,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetIconCacheData
- ENDIF
-
- ;
- ; pascal OSErr SetIconCacheData(IconCacheRef theCache, void *theData)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _SetIconCacheData
- move.w #$041A,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION SetIconCacheData
- ENDIF
-
- ;
- ; pascal OSErr GetIconCacheProc(IconCacheRef theCache, IconGetterUPP *theProc)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _GetIconCacheProc
- move.w #$041B,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetIconCacheProc
- ENDIF
-
- ;
- ; pascal OSErr SetIconCacheProc(IconCacheRef theCache, IconGetterUPP theProc)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _SetIconCacheProc
- move.w #$041C,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION SetIconCacheProc
- ENDIF
-
- ;
- ; pascal OSErr PlotIconHandle(const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theIcon)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _PlotIconHandle
- move.w #$061D,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION PlotIconHandle
- ENDIF
-
- ;
- ; pascal OSErr PlotSICNHandle(const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theSICN)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _PlotSICNHandle
- move.w #$061E,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION PlotSICNHandle
- ENDIF
-
- ;
- ; pascal OSErr PlotCIconHandle(const Rect *theRect, IconAlignmentType align, IconTransformType transform, CIconHandle theCIcon)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _PlotCIconHandle
- move.w #$061F,D0
- dc.w $ABC9
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION PlotCIconHandle
- ENDIF
-
-
-
-
-
-
-
-
-
-
-
-
- ; IconServices is an efficient mechanism to share icon data amongst multiple
- ; clients. It avoids duplication of data; it provides efficient caching,
- ; releasing memory when the icon data is no longer needed; it can provide
- ; the appropriate icon for any filesystem object; it can provide commonly
- ; used icons (caution, note, help...); it is Appearance-savvy: the icons
- ; are switched when appropriate.
- ; To refer to a cached icon data, IconServices uses IconRef, a 32-bit
- ; opaque value. IconRefs are reference counted. When there are no more clients
- ; for an IconRef, the bitmap memory associated with it is marked as disposeable.
- ; Two files of same type and creator with no custom icon will have the same IconRef.
- ; Files with custom icons will have their own IconRef.
-
-
-
-
- ; Use the special creator kSystemIconsCreator to get "standard" icons
- ; that are not associated with a file, such as the help icon.
-
-
-
- kSystemIconsCreator EQU 'macs'
-
-
- ; Type of the predefined/generic icons. For example, the call:
- ; GetIconRef(kOnSystemDisk, kSystemIconsCreator, kHelpIcon, &iconRef);
- ; will retun in iconRef the IconRef for the standard help icon.
-
-
-
- ; Generic Finder icons
-
- kClipboardIcon EQU 'CLIP'
- kClippingUnknownTypeIcon EQU 'clpu'
- kClippingPictureTypeIcon EQU 'clpp'
- kClippingTextTypeIcon EQU 'clpt'
- kClippingSoundTypeIcon EQU 'clps'
- kDesktopIcon EQU 'desk'
- kFinderIcon EQU 'FNDR'
- kFontSuitcaseIcon EQU 'FFIL'
- kFullTrashIcon EQU 'ftrh'
- kGenericApplicationIcon EQU 'APPL'
- kGenericCDROMIcon EQU 'cddr'
- kGenericControlPanelIcon EQU 'APPC'
- kGenericControlStripModuleIcon EQU 'sdev'
- kGenericComponentIcon EQU 'thng'
- kGenericDeskAccessoryIcon EQU 'APPD'
- kGenericDocumentIcon EQU 'docu'
- kGenericEditionFileIcon EQU 'edtf'
- kGenericExtensionIcon EQU 'INIT'
- kGenericFileServerIcon EQU 'srvr'
- kGenericFontIcon EQU 'ffil'
- kGenericFontScalerIcon EQU 'sclr'
- kGenericFloppyIcon EQU 'flpy'
- kGenericHardDiskIcon EQU 'hdsk'
- kGenericRemovableMediaIcon EQU 'rmov'
- kGenericMoverObjectIcon EQU 'movr'
- kGenericPCCardIcon EQU 'pcmc'
- kGenericPreferencesIcon EQU 'pref'
- kGenericQueryDocumentIcon EQU 'qery'
- kGenericRAMDiskIcon EQU 'ramd'
- kGenericSharedLibaryIcon EQU 'shlb'
- kGenericStationeryIcon EQU 'sdoc'
- kGenericSuitcaseIcon EQU 'suit'
- kGenericWORMIcon EQU 'worm'
- kInternationResourcesIcon EQU 'ifil'
- kKeyboardLayoutIcon EQU 'kfil'
- kSoundFileIcon EQU 'sfil'
- kSystemSuitcaseIcon EQU 'zsys'
- kTrashIcon EQU 'trsh'
- kTrueTypeFontIcon EQU 'tfil'
- kTrueTypeFlatFontIcon EQU 'sfnt'
- kTrueTypeMultiFlatFontIcon EQU 'ttcf'
- ; Internet locations
-
- kInternetLocationHTTPIcon EQU 'ilht'
- kInternetLocationFTPIcon EQU 'ilft'
- kInternetLocationAppleShareIcon EQU 'ilaf'
- kInternetLocationAppleTalkZoneIcon EQU 'ilat'
- kInternetLocationFileIcon EQU 'ilfi'
- kInternetLocationMailIcon EQU 'ilma'
- kInternetLocationNewsIcon EQU 'ilnw'
- kInternetLocationGenericIcon EQU 'ilge'
- ; Folders
-
- kGenericFolderIcon EQU 'fldr'
- kDropFolderIcon EQU 'dbox'
- kMountedFolderIcon EQU 'mntd'
- kOpenFolderIcon EQU 'ofld'
- kOwnedFolderIcon EQU 'ownd'
- kPrivateFolderIcon EQU 'prvf'
- kSharedFolderIcon EQU 'shfl'
- ; Sharing Privileges icons
-
- kSharingPrivsNotApplicableIcon EQU 'shna'
- kSharingPrivsReadOnlyIcon EQU 'shro'
- kSharingPrivsReadWriteIcon EQU 'shrw'
- kSharingPrivsUnknownIcon EQU 'shuk'
- kSharingPrivsWritableIcon EQU 'writ'
-
- ; Users and Groups icons
-
- kUserFolderIcon EQU 'ufld'
- kWorkgroupFolderIcon EQU 'wfld'
- kGuestUserIcon EQU 'gusr'
- kUserIcon EQU 'user'
- kOwnerIcon EQU 'susr'
- kGroupIcon EQU 'grup'
- ; Special folders
-
- kAppleExtrasFolderIcon EQU 'aexƒ'
- kAppleMenuFolderIcon EQU 'amnu'
- kApplicationsFolderIcon EQU 'apps'
- kApplicationSupportFolderIcon EQU 'asup'
- kAssistantsFolderIcon EQU 'astƒ'
- kContextualMenuItemsFolderIcon EQU 'cmnu'
- kControlPanelDisabledFolderIcon EQU 'ctrD'
- kControlPanelFolderIcon EQU 'ctrl'
- kControlStripModulesFolderIcon EQU 'sdvƒ'
- kDocumentsFolderIcon EQU 'docs'
- kExtensionsDisabledFolderIcon EQU 'extD'
- kExtensionsFolderIcon EQU 'extn'
- kFavoritesFolderIcon EQU 'favs'
- kFontsFolderIcon EQU 'font'
- kHelpFolderIcon EQU 'ƒhlp'
- kInternetFolderIcon EQU 'intƒ'
- kInternetPlugInFolderIcon EQU 'ƒnet'
- kMacOSReadMeFolderIcon EQU 'morƒ'
- kPreferencesFolderIcon EQU 'prfƒ'
- kPrinterDescriptionFolderIcon EQU 'ppdf'
- kPrinterDriverFolderIcon EQU 'ƒprd'
- kPrintMonitorFolderIcon EQU 'prnt'
- kRecentApplicationsFolderIcon EQU 'rapp'
- kRecentDocumentsFolderIcon EQU 'rdoc'
- kRecentServersFolderIcon EQU 'rsrv'
- kScriptingAdditionsFolderIcon EQU 'ƒscr'
- kSharedLibrariesFolderIcon EQU 'ƒlib'
- kScriptsFolderIcon EQU 'scrƒ'
- kShutdownItemsDisabledFolderIcon EQU 'shdD'
- kShutdownItemsFolderIcon EQU 'shdf'
- kSpeakableItemsFolder EQU 'spki'
- kStartupItemsDisabledFolderIcon EQU 'strD'
- kStartupItemsFolderIcon EQU 'strt'
- kSystemExtensionDisabledFolderIcon EQU 'macD'
- kSystemFolderIcon EQU 'macs'
- kTextEncodingsFolderIcon EQU 'ƒtex'
- kAppearanceFolderIcon EQU 'appr'
- kUtilitiesFolderIcon EQU 'utiƒ'
- kVoicesFolderIcon EQU 'fvoc'
- kColorSyncFolderIcon EQU 'prof'
- kInternetSearchSitesFolderIcon EQU 'issf'
- ; Badges
-
- kAppleScriptBadgeIcon EQU 'scrp'
- kLockedBadgeIcon EQU 'lbdg'
- kMountedBadgeIcon EQU 'mbdg'
- kSharedBadgeIcon EQU 'sbdg'
- kAliasBadgeIcon EQU 'abdg'
- ; Alert icons
-
- kAlertNoteIcon EQU 'note'
- kAlertCautionIcon EQU 'caut'
- kAlertStopIcon EQU 'stop'
- ; Networking icons
-
- kAppleTalkIcon EQU 'atlk'
- kAppleTalkZoneIcon EQU 'atzn'
- kAFPServerIcon EQU 'afps'
- kFTPServerIcon EQU 'ftps'
- kIPFileServerIcon EQU 'isrv'
- ; Other icons
-
- kAppleLogoIcon EQU 'capl'
- kAppleMenuIcon EQU 'sapl'
- kBackwardArrowIcon EQU 'baro'
- kFavoriteItemsIcon EQU 'favr'
- kForwardArrowIcon EQU 'faro'
- kGridIcon EQU 'grid'
- kHelpIcon EQU 'help'
- kKeepArrangedIcon EQU 'arng'
- kLockedIcon EQU 'lock'
- kNoFilesIcon EQU 'nfil'
- kNoFolderIcon EQU 'nfld'
- kNoWriteIcon EQU 'nwrt'
- kProtectedApplicationFolderIcon EQU 'papp'
- kProtectedSystemFolderIcon EQU 'psys'
- kRecentItemsIcon EQU 'rcnt'
- kShortcutIcon EQU 'shrt'
- kSortAscendingIcon EQU 'asnd'
- kSortDescendingIcon EQU 'dsnd'
- kUnlockedIcon EQU 'ulck'
- kConnectToIcon EQU 'cnct'
-
- ; Error codes range from -2580 to -2599
-
- invalidIconRefErr EQU -2580
- noSuchIconErr EQU -2581
- noIconDataAvailableErr EQU -2582
-
- ; IconServicesUsageFlags
- ; typedef UInt32 IconServicesUsageFlags
-
-
- kIconServicesNormalUsageFlag EQU 0
-
-
- ; IconFamily 'icns' resources contain an entire IconFamily (all sizes and depths).
- ; For custom icons, icns IconFamily resources of the custom icon resource ID are fetched first before
- ; the classic custom icons (individual 'ics#, ICN#, etc) are fetched. If the fetch of the icns resource
- ; succeeds then the icns is looked at exclusively for the icon data.
- ; For custom icons, new icon features such as 32-bit deep icons are only fetched from the icns resource.
- ; This is to avoid incompatibilities with cut & paste of new style icons with an older version of the
- ; MacOS Finder.
- ; DriverGestalt is called with code kdgMediaIconSuite by IconServices after calling FSM to determine a
- ; driver icon for a particular device. The result of the kdgMediaIconSuite call to DriverGestalt should
- ; be a pointer an an IconFamily. In this manner driver vendors can provide rich, detailed drive icons
- ; instead of the 1-bit variety previously supported.
-
-
-
- kIconFamilyType EQU 'icns'
-
- IconFamilyElement RECORD 0
- elementType ds.l 1 ; offset: $0 (0) ; 'ICN#', 'icl8', etc...
- elementSize ds.l 1 ; offset: $4 (4) ; Size of this element
- elementData ds.b 1 ; offset: $8 (8) <-- really an array of length one
- ORG 10
- sizeof EQU * ; size: $A (10)
- ENDR
- IconFamilyResource RECORD 0
- resourceType ds.l 1 ; offset: $0 (0) ; Always 'icns'
- resourceSize ds.l 1 ; offset: $4 (4) ; Total size of this resource
- elements ds IconFamilyElement ; offset: $8 (8) <-- really an array of length one
- sizeof EQU * ; size: $12 (18)
- ENDR
- ; typedef struct IconFamilyResource * IconFamilyPtr
-
- ; typedef IconFamilyPtr * IconFamilyHandle
-
-
-
- ; ==============================================================================
- ; Initialization and Termination
- ; ==============================================================================
-
-
-
-
-
- ; IconServicesInit
- ;
- ; Call this routine once per classic 68K application initialization.
- ; This routine does not need to be called at boot time.
-
-
-
- ;
- ; pascal OSErr IconServicesInit(CFragInitBlockPtr initBlockPtr)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _IconServicesInit
- moveq #21,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IconServicesInit
- ENDIF
-
-
-
- ; IconServicesTerminate:
- ;
- ; Call this routine once from the termination of a classic 68K application.
- ; This routine does not need to be called at boot time.
-
-
-
- ;
- ; pascal void IconServicesTerminate(void )
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _IconServicesTerminate
- moveq #22,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IconServicesTerminate
- ENDIF
-
-
-
-
- ; ==============================================================================
- ; Converting data structures
- ; ==============================================================================
-
-
-
-
-
- ; IconRefToIconFamily
- ; This routines returns a new IconFamily that contains the data corresponding
- ; to the specified IconRef
-
-
-
- ;
- ; pascal OSErr IconRefToIconFamily(IconRef theIconRef, IconSelectorValue whichIcons, IconFamilyHandle *iconFamily)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _IconRefToIconFamily
- moveq #36,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IconRefToIconFamily
- ENDIF
-
-
-
- ; IconFamilyToIconSuite
- ; This routines transfers the data in an icon family into an icon suite.
-
-
-
- ;
- ; pascal OSErr IconFamilyToIconSuite(IconFamilyHandle iconFamily, IconSelectorValue whichIcons, IconSuiteRef *iconSuite)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _IconFamilyToIconSuite
- moveq #37,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IconFamilyToIconSuite
- ENDIF
-
-
-
- ; IconSuiteToIconFamily
- ; This routines transfers the data in an icon suite into an icon family.
-
-
-
- ;
- ; pascal OSErr IconSuiteToIconFamily(IconSuiteRef iconSuite, IconSelectorValue whichIcons, IconFamilyHandle *iconFamily)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _IconSuiteToIconFamily
- moveq #38,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IconSuiteToIconFamily
- ENDIF
-
-
-
- ; SetIconFamilyData
- ; Change the data of an icon family. The data is copied.
- ; The type can be one of the icon type, or 'PICT'
- ; The data will be compressed if needed.
-
-
-
- ;
- ; pascal OSErr SetIconFamilyData(IconFamilyHandle iconFamily, OSType iconType, Handle h)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _SetIconFamilyData
- moveq #48,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION SetIconFamilyData
- ENDIF
-
-
-
- ; GetIconFamilyData
- ; Return a copy of the data in the icon family.
- ; The type can be one of the icon type, or 'PICT'
- ; The data will be returned uncompressed.
-
-
-
- ;
- ; pascal OSErr GetIconFamilyData(IconFamilyHandle iconFamily, OSType iconType, Handle h)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _GetIconFamilyData
- moveq #49,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetIconFamilyData
- ENDIF
-
-
-
- ; ==============================================================================
- ; Reference counting
- ; ==============================================================================
-
-
-
-
-
- ; GetIconRefOwners
- ;
- ; This routine returns the reference count for the IconRef, or number of owners.
- ;
- ; A valid IconRef always has at least one owner.
-
-
-
- ;
- ; pascal OSErr GetIconRefOwners(IconRef theIconRef, UInt16 *owners)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _GetIconRefOwners
- moveq #11,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetIconRefOwners
- ENDIF
-
-
-
- ; AcquireIconRef
- ; This routine increments the reference count for the IconRef
-
-
-
- ;
- ; pascal OSErr AcquireIconRef(IconRef theIconRef)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _AcquireIconRef
- moveq #39,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION AcquireIconRef
- ENDIF
-
-
-
-
- ; ReleaseIconRef
- ;
- ; This routine decrements the reference count for the IconRef.
- ;
- ; When the reference count reaches 0, all memory allocated for the icon
- ; is disposed. Any subsequent use of the IconRef is invalid.
-
-
-
- ;
- ; pascal OSErr ReleaseIconRef(IconRef theIconRef)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _ReleaseIconRef
- moveq #40,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION ReleaseIconRef
- ENDIF
-
-
-
-
- ; ==============================================================================
- ; Getting an IconRef
- ; ==============================================================================
-
-
-
-
-
- ; GetIconRefFromFile
- ;
- ; This routine returns an icon ref for the specified file, folder or volume.
- ; The label information is provided separately, since two files with the same icon
- ; but a different label would share the same iconRef. The label can be used in
- ; PlotIconRef() for example.
- ;
- ; Use this routine if you have no information about the file system object. If
- ; you have already done a GetCatInfo on the file and want to save some I/O,
- ; call GetIconRefFromFolder() if you know it's a folder with no custom icon or
- ; call GetIconRef() if it's a file with no custom icon.
- ; This routine increments the reference count of the returned IconRef. Call
- ; ReleaseIconRef() when you're done with it.
-
-
-
- ;
- ; pascal OSErr GetIconRefFromFile(const FSSpec *theFile, IconRef *theIconRef, SInt16 *theLabel)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _GetIconRefFromFile
- moveq #2,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetIconRefFromFile
- ENDIF
-
-
-
-
- ; GetIconRef
- ;
- ; This routine returns an icon ref for an icon in the desktop database or
- ; for a registered icon.
- ; The system registers a set of icon such as the help icon with the creator
- ; code kSystemIconCreator. See above for a list of the registered system types.
- ; The vRefNum is used as a hint on where to look for the icon first. Use
- ; kOnSystemDisk if you don't know what to pass.
- ; This routine increments the reference count of the returned IconRef. Call
- ; ReleaseIconRef() when you're done with it.
-
-
-
- ;
- ; pascal OSErr GetIconRef(SInt16 vRefNum, OSType creator, OSType iconType, IconRef *theIconRef)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _GetIconRef
- moveq #33,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetIconRef
- ENDIF
-
-
-
-
- ; GetIconRefFromFolder
- ;
- ; This routine returns an icon ref for a folder with no custom icon.
- ; Use the more generic, but slightly slower, GetIconRefFromFile() if
- ; you don't already have the necessary info about the file.
- ; Attributes should be CInfoPBRec.dirInfo.ioFlAttrib for this folder.
- ; Access privileges should be CInfoPBRec.dirInfo.ioACUser for this folder.
- ; This routine increments the reference count of the IconRef. Call ReleaseIconRef()
- ; when you're done with it.
-
-
-
- ;
- ; pascal OSErr GetIconRefFromFolder(SInt16 vRefNum, SInt32 parentFolderID, SInt32 folderID, SInt8 attributes, SInt8 accessPrivileges, IconRef *theIconRef)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _GetIconRefFromFolder
- moveq #34,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetIconRefFromFolder
- ENDIF
-
-
-
-
- ; ==============================================================================
- ; Adding and modifying IconRef
- ; ==============================================================================
-
-
-
-
-
- ; RegisterIconRefFromIconFamily
- ; This routine adds a new entry to the IconRef registry. Other clients will be
- ; able to access it using the (creator, iconType) pair specified here.
- ; Lower-case creators are reserved for the system.
- ; Consider using RegisterIconRefFromResource() if possible, since the data
- ; registered using RegisterIconRefFromFamily() cannot be purged.
- ; The iconFamily data is copied and the caller is reponsible for disposing of it.
- ; This routine increments the reference count of the IconRef. Call ReleaseIconRef()
- ; when you're done with it.
-
-
-
- ;
- ; pascal OSErr RegisterIconRefFromIconFamily(OSType creator, OSType iconType, IconFamilyHandle iconFamily, IconRef *theIconRef)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _RegisterIconRefFromIconFamily
- moveq #28,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION RegisterIconRefFromIconFamily
- ENDIF
-
-
-
- ; RegisterIconRefFromResource
- ;
- ; Registers an IconRef from a resouce file.
- ; The icon data to be fetched is either classic icon data or an icon family.
- ; The 'icns' icon family is searched for before the classic icon data.
- ; This routine increments the reference count of the IconRef. Call ReleaseIconRef()
- ; when you're done with it.
-
-
-
- ;
- ; pascal OSErr RegisterIconRefFromResource(OSType creator, OSType iconType, const FSSpec *resourceFile, SInt16 resourceID, IconRef *theIconRef)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _RegisterIconRefFromResource
- moveq #35,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION RegisterIconRefFromResource
- ENDIF
-
-
-
- ; UnregisterIconRef
- ;
- ; Removes the specified icon from the icon cache (if there are no users of it).
- ; If some clients are using this iconRef, then the IconRef will be removed when the
- ; last user calls ReleaseIconRef.
-
-
-
- ;
- ; pascal OSErr UnregisterIconRef(OSType creator, OSType iconType)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _UnregisterIconRef
- moveq #8,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION UnregisterIconRef
- ENDIF
-
-
-
-
- ; UpdateIconRef
- ;
- ; Call this routine to force an update of the data for iconRef.
- ;
- ; For example after changing an icon in the desktop database or changing the custom
- ; icon of a file. Note that after _adding_ a custom icon to file or folder, you
- ; need to call GetIconRefFromFile() to get a new IconRef specific to this file.
- ;
- ; This routine does nothing if the IconRef is a registered icon.
-
-
-
- ;
- ; pascal OSErr UpdateIconRef(IconRef theIconRef)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _UpdateIconRef
- moveq #9,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION UpdateIconRef
- ENDIF
-
-
-
-
- ; OverrideIconRefFromResource
- ;
- ; This routines replaces the bitmaps of the specified IconRef with the ones
- ; in the specified resource file.
-
-
-
- ;
- ; pascal OSErr OverrideIconRefFromResource(IconRef theIconRef, const FSSpec *resourceFile, SInt16 resourceID)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _OverrideIconRefFromResource
- moveq #42,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION OverrideIconRefFromResource
- ENDIF
-
-
-
-
- ; OverrideIconRef
- ;
- ; This routines replaces the bitmaps of the specified IconRef with the ones
- ; from the new IconRef.
-
-
-
- ;
- ; pascal OSErr OverrideIconRef(IconRef oldIconRef, IconRef newIconRef)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _OverrideIconRef
- moveq #43,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION OverrideIconRef
- ENDIF
-
-
-
- ; RemoveIconRefOverride
- ; This routine remove an override if one was applied to the icon and
- ; reverts back to the original bitmap data.
-
-
-
- ;
- ; pascal OSErr RemoveIconRefOverride(IconRef theIconRef)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _RemoveIconRefOverride
- moveq #30,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION RemoveIconRefOverride
- ENDIF
-
-
-
-
- ; ==============================================================================
- ; Creating composite IconRef
- ; ==============================================================================
-
-
-
-
-
- ; CompositeIconRef
- ;
- ; Superimposes an IconRef on top of another one
-
-
-
- ;
- ; pascal OSErr CompositeIconRef(IconRef backgroundIconRef, IconRef foregroundIconRef, IconRef *compositeIconRef)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _CompositeIconRef
- moveq #20,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION CompositeIconRef
- ENDIF
-
-
-
- ; IsIconRefComposite
- ; Indicates if a given icon ref is a composite of two other icon refs (and which ones)
- ; If it isn't a composite, backgroundIconRef and foreGroundIconRef will be 0.
-
-
-
- ;
- ; pascal OSErr IsIconRefComposite(IconRef compositeIconRef, IconRef *backgroundIconRef, IconRef *foregroundIconRef)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _IsIconRefComposite
- moveq #26,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IsIconRefComposite
- ENDIF
-
-
-
-
- ; ==============================================================================
- ; Using IconRef
- ; ==============================================================================
-
-
-
-
- ; IsValidIconRef
- ; Return true if the iconRef passed in is a valid icon ref
-
-
-
- ;
- ; pascal Boolean IsValidIconRef(IconRef theIconRef)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _IsValidIconRef
- moveq #50,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IsValidIconRef
- ENDIF
-
-
-
- ; PlotIconRef
- ;
- ; This routine plots the IconRef. It mostly takes the same parameters as PlotIconSuite.
- ; Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
-
-
-
- ;
- ; pascal OSErr PlotIconRef(const Rect *theRect, IconAlignmentType align, IconTransformType transform, IconServicesUsageFlags theIconServicesUsageFlags, IconRef theIconRef)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _PlotIconRef
- moveq #14,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION PlotIconRef
- ENDIF
-
-
-
- ; PtInIconRef
- ;
- ; This routine indicates if testPt would hit the icon designated by iconRef.
- ; It mostly takes the same parameters as PtInIconSuite.
- ; Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
-
-
-
-
- ;
- ; pascal Boolean PtInIconRef(const Point *testPt, const Rect *iconRect, IconAlignmentType align, IconServicesUsageFlags theIconServicesUsageFlags, IconRef theIconRef)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _PtInIconRef
- moveq #15,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION PtInIconRef
- ENDIF
-
-
-
- ; RectInIconRef
- ;
- ; This routine indicates if testRect would intersect the icon designated by iconRef.
- ; It mostly takes the same parameters as RectInIconSuite.
- ; Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
-
-
-
-
- ;
- ; pascal Boolean RectInIconRef(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, IconServicesUsageFlags iconServicesUsageFlags, IconRef theIconRef)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _RectInIconRef
- moveq #16,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION RectInIconRef
- ENDIF
-
-
-
- ; IconRefToRgn
- ;
- ; This routine returns a region for the icon.
- ; It mostly takes the same parameters as IconSuiteToRgn.
- ; Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
-
-
-
- ;
- ; pascal OSErr IconRefToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, IconServicesUsageFlags iconServicesUsageFlags, IconRef theIconRef)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _IconRefToRgn
- moveq #17,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IconRefToRgn
- ENDIF
-
-
-
- ; GetIconSizesFromIconRef
- ;
- ; This routine returns an IconSelectorValue indicating the depths and sizes of
- ; icon data which are actually available. It takes an IconSelectorValue
- ; indicating which sizes/depths the caller is interested and returns an
- ; IconSelectorValue indicating which sizes/depths exist.
- ;
- ; Caution:
- ;
- ; This is potentially an extremely expensive call as IconServices may be forced
- ; to attempt fetching the data for the IconRef's sizes/depths which may result
- ; in hitting the local disk or even the network to obtain the data to determine
- ; which sizes/depths actually exist.
- ; Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
-
-
-
- ;
- ; pascal OSErr GetIconSizesFromIconRef(IconSelectorValue iconSelectorInput, IconSelectorValue *iconSelectorOutputPtr, IconServicesUsageFlags iconServicesUsageFlags, IconRef theIconRef)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _GetIconSizesFromIconRef
- moveq #18,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetIconSizesFromIconRef
- ENDIF
-
-
-
-
- ; ==============================================================================
- ; Flushing IconRef data
- ; ==============================================================================
-
-
-
-
-
- ; FlushIconRefs
- ;
- ; Making this call will dispose of all the data for the specified icons if
- ; the data can be reacquired, for example if the data is provided from a resource.
- ; '****' is a wildcard for all types or all creators.
-
-
-
- ;
- ; pascal OSErr FlushIconRefs(OSType creator, OSType iconType)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _FlushIconRefs
- moveq #41,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION FlushIconRefs
- ENDIF
-
-
-
- ; FlushIconRefsByVolume
- ;
- ; This routine disposes of the data for the icons related to the indicated volume
- ; if this data can be reacquired, for example if the data is provided from a
- ; resource.
-
-
-
- ;
- ; pascal OSErr FlushIconRefsByVolume(SInt16 vRefNum)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _FlushIconRefsByVolume
- moveq #24,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION FlushIconRefsByVolume
- ENDIF
-
-
-
-
- ; ==============================================================================
- ; Controling custom icons
- ; ==============================================================================
-
-
-
-
-
- ; SetCustomIconsEnabled
- ;
- ; Enable or disable custom icons on the specified volume.
-
-
-
- ;
- ; pascal OSErr SetCustomIconsEnabled(SInt16 vRefNum, Boolean enableCustomIcons)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _SetCustomIconsEnabled
- moveq #31,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION SetCustomIconsEnabled
- ENDIF
-
-
-
- ; GetCustomIconsEnabled
- ;
- ; Return true if custom icons are enabled on the specified volume, false otherwise.
-
-
-
- ;
- ; pascal OSErr GetCustomIconsEnabled(SInt16 vRefNum, Boolean *customIconsEnabled)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _GetCustomIconsEnabled
- moveq #32,D0
- dc.w $AA75
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetCustomIconsEnabled
- ENDIF
-
-
-
- ENDIF ; __ICONS__
-
-